home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 6: Level 6
/
17 Bit - Level 6 (1998)(Epic Marketing)[!].iso
/
quartz
/
q1169.dms
/
q1169.adf
/
SayTime
/
SayTime.bas
< prev
next >
Wrap
BASIC Source File
|
1997-04-10
|
1KB
|
63 lines
DEFINT a-z
REM $INCLUDE Exec.bh
REM $INCLUDE Intuition.bh
REM $INCLUDE Dos.bh
LIBRARY OPEN "exec.library"
LIBRARY OPEN "intuition.library"
LIBRARY OPEN "dos.library"
mempoint&=allocmem&(100,MEMF_ANY)
hour=VAL(LEFT$(TIME$,2))
min$=RIGHT$(TIME$,6)
IF hour>11 THEN
hour=hour-12
END IF
t$=LTRIM$(STR$(hour)+min$)
st$="Say Time "+CHR$(169)+" T.Collier 1995. "
st$=st$+MID$(DATE$,4,3)+LEFT$(DATE$,3)+RIGHT$(DATE$,4)+" "+t$+CHR$(0)
a&=SADD(st$)
l&=LEN(st$)
copymem a&,mempoint&,l&
WINDOW 1,"",(500,11)-(90,20),64+128+256,-1
SetWindowTitles WINDOW(7),-1,mempoint&
DIM num$(15)
RESTORE Numbers
FOR f=0 TO 15
READ a$
num$(f)=a$
NEXT f
t$=TIME$
h$=LEFT$(t$,2)
m$=MID$(t$,4,2)
a=VAL(h$)
IF a=0 THEN a=12
IF a>12 THEN
a=a-12
t$=" P M"
ELSE
t$=" AY M"
END IF
h$=num$(a)+" "
a=VAL(m$)
IF a<16 THEN m$=num$(a)
IF a>15 AND a<20 THEN m$=num$(a-10)+" teen"
IF a>19 AND a<30 THEN m$="twenty "+num$(a-20)
IF a>29 AND a<40 THEN m$="thirty "+num$(a-30)
IF a>39 AND a<50 THEN m$="forty "+num$(a-40)
IF a>49 AND a<60 THEN m$="fifty "+num$(a-50)
m$=m$+t$
SAY TRANSLATE$(h$)
SAY TRANSLATE$(m$)
delay(100)
freemem mempoint&,100
STOP -1
Numbers:
DATA " ","1","2","3","4","5","6","7","8","9","ten","E levn","twelve"
DATA "thir teen","four teen","fif teen"